<?php 
/**
 * @Copyright Copyright (C) 2010-2012
 * @license GNU/GPL http://www.gnu.org/copyleft/gpl.html
 + Created by:          Webit Solution
 * Company:		Webit Solution
 + Contact:		www.webits.asia, developer@webits.asia
 * Created on:	Mar 21, 2012
 ^
 + Project: 		WRecruit
 * File Name:	views/jobseeker/tmpl/candidateprofile.php
 ^ 
 * Description: template view for control panel
 ^ 
 * History:		NONE
 ^ 
 */
 
 defined('_JEXEC') or die('Restricted access');
  global $mainframe;
  $document =& JFactory::getDocument();
  $form = JRequest::getVar("form");
 
?>
<script type="text/javascript">
	function forwardMessage(){
		var forward = document.getElementById('combobox').value;
		var empid = document.getElementById('empid').value;
		var msg = document.getElementById('employer-body-message').value;
		var subject = document.getElementById('subject').value;
		var data = forward.split(",");
		window.location = "index.php?option=com_wrecruit&c=wrecruit&task=sendtocandidate&box=candidate_sent&sort=DESC&page=1&cid="+data[0]+"&email="+data[1]+"&empid="+empid+"&subject="+subject+"&message="+msg+"&Itemid=<?php echo $this->Itemid;?>";
	}
</script>
<?php 
	if($form=='jobpreview') {?>
		<a id="close" class="hidden" title="close popup"></a>
           <div class="content-left">
				<div class="box-list">
					<?php if (JRequest::getVar('jobtitle')!=null) {
						echo '<div class="head-title">';
							echo '<h2>' .JRequest::getVar('jobtitle'). '</h2>';
						echo '</div>';
					}?>
					<div class="post-detail-box">
						<div class="post-detail-text">
							<p>
								<span class="title">Employer:</span>
								<span class="description">DIGITAL GURUS</span>
							</p>
							
							<p>
								<span class="title">Posted:</span>
								<span class="description"><?php echo date("d M Y");?></span>
							</p>
							<p>
								<span class="title">Contact:</span>
								<span class="description">claudio de palma</span>
							</p>
							<p>
								<span class="title">Locatoin:</span>
								<span class="description">London</span>
							</p>
							<p>
								<span class="title">Industry:</span>
								<span class="description industry">Marketing &amp; PR, Media- Advertising, Media - Digital Media
								</span>
							</p>
							<p>
								<span class="title">Function:</span>
								<span class="description">Sales</span>
							</p>
							<p>
								<span class="title">Contract:</span>
								<span class="description">Permanent</span>
							</p>
							<p>
								<span class="title">Hours:</span>
								<span class="description">Full Time</span>
							</p>
							<p>
								<span class="title">Salary:</span>
								<span class="description">45000 - 55000 per annum + OTE	to 80k</span>
							</p>
						</div>
						
						<div class="post-detail-right">
							<div class="post-image"><img src="images/post-logo.gif" width="142" height="50" alt="" title="" /></div>
							<div class="post-image"><a href="#"><img src="images/apply-cv.gif" width="142" height="27" alt="" title="" /></a></div>
						</div>
					</div>
				</div>
				
				<div class="box-list further-info-box">
					<div class="head-title">
						<h2>Further Information</h2>
					</div>
					<div class="further-infomation">
						<h3><?php echo JRequest::getVar('jobtitle');?></h3>
						<h4>Organisation</h4>
						<p>For one of our prestigious client, a leading international FMCG company based in Brussels area, we are looking for a talented and evolutive Supply Chain and Demand Manager to develop a supply chain structure!</p>
						<h4>Job description</h4>
						 <p><?php echo JRequest::getVar('description');?></p>
 						<h4>Requirements</h4>
 						<p><?php echo JRequest::getVar('qualifications');?></p>
						<h4>Offer</h4>
						<p>Attractive salary package in line with experience</p>
					</div>
				</div>
				
			</div>		
		
	<?php }
	if ($form=='sendmessage') { ?>
		 <a id="close" class="hidden" title="close popup"></a>   
		    <form action="index.php" method="post">
			    <div class="pop-content1" id="wrapp-send-message">
			        <div class="head-title" id="pop-head">
			            <h2>Send message</h2>
			        </div>
			      <div class="pop"><label class="pop-label-message">Send to:</label>
			      	<input type="text" class="employer-message" name="employer-send-to" placeholder="Candidate1..." value="<?php echo $_POST['candidatename'];?>" disabled="disabled" />
			      	<input type= "hidden" name="email" value="<?php echo $_POST['candidateemail'];?>" />
	 		      </div>
			       <div class="pop"><label class="pop-label-message">Subject:</label>
			      	<input type="text" class="employer-message" name="subject" placeholder="Message subject goes here..." />
			      </div>
			      <div class="">
			      	<textarea id="employer-body-message" name="message">Employer's message goes here...</textarea>
			      </div>
					<!-- <input type="hidden" name="view" value="employer" />
					<input type="hidden" name="layout" value="sendmessage" />-->
					<input type="hidden" name="cid" value="<?php echo $_POST['cid'];?>" />
					<input type="hidden" name="empid" value="<?php echo $_POST['empid'];?>" />
					<input type="hidden" name="uid" value="<?php echo $this->uid; ?>" />
					<input type="hidden" name="option" value="<?php echo JRequest::getVar('option'); ?>" />
					<input type="hidden" name="task" value="sendtocandidate" />
			      <div class="btn-action"><input type="submit" value="Send"  id="send-message" class="btn"/></div>
			        
			    </div>
		    </form>
	<?php }
	if ($form=='replymessage') { ?>
		<?php 
			$items = explode(',',$_POST['candidatename']);
			$name = $items[0];
			$subject = $items[1];
		?>
		 <a id="close" class="hidden" title="close popup"></a>   
		    <form action="index.php" method="post">
			    <div class="pop-content1" id="wrapp-send-message">
			        <div class="head-title" id="pop-head">
			            <h2>Reply message</h2>
			        </div>
			      <div class="pop"><label class="pop-label-message">Send to:</label>
			      	<input type="text" class="employer-message" name="employer-send-to" value="<?php echo $name;?>" disabled="disabled" />
			      	<input type= "hidden" name="email" value="<?php echo $_POST['candidateemail'];?>" />
	 		      </div>
			       <div class="pop"><label class="pop-label-message">Subject:</label>
			      	<input type="text" class="employer-message" name="subject" value="Re: <?php echo $subject;?> " />
			      </div>
			      <div class="">
			      	<textarea id="employer-body-message" name="message">Employer's message goes here...</textarea>
			      </div>
					<!-- <input type="hidden" name="view" value="employer" />
					<input type="hidden" name="layout" value="sendmessage" />-->
					<input type="hidden" name="cid" value="<?php echo $_POST['cid'];?>" />
					<input type="hidden" name="empid" value="<?php echo $_POST['empid'];?>" />
					<input type="hidden" name="option" value="<?php echo JRequest::getVar('option'); ?>" />
					<input type="hidden" name="task" value="sendtocandidate" />
			      <div class="btn-action"><input type="submit" value="Reply"  id="send-message" class="btn"/></div>
			        
			    </div>
		    </form>
	<?php }
	if ($form=='forwardmessage') { ?>
		<?php 
			$model = $this->getModel('wrecruit', 'WRecruitModel');
			$items = explode(',',$_POST['candidatename']);
			$name = $items[0];
			$subject = $items[1];
			$data = $model->listCandidates();
		?>
		 <a id="close" class="hidden" title="close popup"></a>   
		    <form action="index.php" method="post">
			    <div class="pop-content1" id="wrapp-send-message">
			        <div class="head-title" id="pop-head">
			            <h2>Forward message</h2>
			        </div>
			      <div class="pop"><label class="pop-label-message">Send to:</label>
			      	<select id="combobox" class="employer-message" name="email">
			      		<?php foreach ($data as $item) {?>
							<option value="<?php echo $item->id.','.$item->email;?>"><?php echo $item->name;?></option>
						<?php }?>
					</select>
			      	<!-- <input type="text" class="employer-message" name="email" /> -->
	 		      </div>
			       <div class="pop"><label class="pop-label-message">Subject:</label>
			      	<input type="text" class="employer-message" id="subject" name="subject" value="Fwd: <?php echo $subject;?> " />
			      </div>
			      <div class="">
			      	<textarea id="employer-body-message" name="message">Employer's message goes here...</textarea>
			      </div>
					<!-- <input type="hidden" name="view" value="employer" />
					<input type="hidden" name="layout" value="sendmessage" />-->
					<input type="hidden" name="cid" value="<?php echo $_POST['cid'];?>" />
					<input type="hidden" id="empid" name="empid" value="<?php echo $_POST['empid'];?>" />
					<input type="hidden" name="option" value="<?php echo JRequest::getVar('option'); ?>" />
					<input type="hidden" name="task" value="sendtocandidate" />
			      <div class="btn-action"><input type="button" value="Forward"  id="send-message" onclick="forwardMessage()" class="btn"/></div>
			        
			    </div>
		    </form>
<?php  } if( $form == 'emailform'){
	?>
         <a id="close" class="hidden" title="close popup"></a>   
        <form action="index.php" method="post">
        
        <div class="pop-content1" style="width:530px;">
            <div class="head-title" id="pop-head">
                <h2>Change Email</h2>
            </div>
          <div class="pop"><label class="pop-label-email">Your new E-mail address:</label>
            <input type="text" class="text-email"  name="new_mail" placeholder="Your new E-mail address..." />
          </div>
           <div class="pop"><label class="pop-label-email">Confirm your new E-mail address:</label>
            <input type="text" class="text-email" name="confirm_new_mail" placeholder="Confirm your new E-mail address..." />
          </div>
          <div class="pop" id="note"><strong>Note:</strong>after this change, later on you will log in with this new email address and al notifications by Email will be also sent to this mail address.</div>
         <div class="btn-action">
            <div class="wrapp-btn">
                <span class="btn-left"><span class="btn-right"><input type="submit" value="Save" class="btn" id="save-email" /> &nbsp;</span></span>
           </div>
         </div>
            <input type="hidden" value="<?php echo JRequest::getVar('empuid');?>" name="uid">
            <input type="hidden" value="account-profile" name="layout">
            <input type="hidden" value="com_wrecruit" name="option">
            <input type="hidden" value="changeMailEmployer" name="task">
             
        </div>
        
        </form>
	<?php 
    } if( $form == 'passwordform'){
		?>
         <a id="close" class="hidden" title="close popup"></a>   
                    <center>
                 <form action="index.php" method="post"> 
                    <div class="pop-content1" id="wrapp-change-password">
                      <div class="head-title" id="pop-head">
                            <h2>Change Password</h2>
                      </div>
                      <div class="pop"><label class="pop-label-email">Your current password:</label>
                        <input type="password" class="text-email"  value="" name="current_password" placeholder="Your current password..." />
                        <span class="star1">&nbsp;</span>
                      </div>
                       <div class="pop"><label class="pop-label-email">Your new password:</label>
                        <input type="password" class="text-email"  value="" name="new_password" placeholder="Your new password..." />
                        <span class="star1">&nbsp;</span>
                      </div>
                       <div class="pop"><label class="pop-label-email">Confirm your new password:</label>
                        <input type="password" class="text-email" value="" name="confirm_new_password" placeholder="Confirm your new password..." />
                        <span class="star1">&nbsp;</span>
                      </div>
                        
                      <div class="btn-action">
                        <div class="wrapp-btn">
                            <span class="btn-left"><span class="btn-right"><input type="submit" value="Save" class="btn" id="save-password" /> &nbsp;</span></span>
                       </div>
                     </div>
                        
                    </div>
                    
                    <input type="hidden" value="<?php echo JRequest::getVar('empuid');?>" name="uid">
                    <input type="hidden" value="account-profile" name="layout">
                    <input type="hidden" value="com_wrecruit" name="option">
                    <input type="hidden" value="changePasswordEmployer" name="task">
        </form>
	<?php }
	
	if ($form=='request_cv') { ?>
		<a id="close" class="hidden" title="close popup"></a>   
	    <center>
	    <form action="index.php" method="post">
	    <div class="pop-content1" id="wrapp-request">
	        <div class="head-title" id="pop-head">
	            <h2>Request for detail</h2>
	        </div>
	        <div class="pop"><label class="pop-label-cv-number">You are requesting the detail of the CV number: 0000001:</label>
	        </div>
	      <div class=""><label class="pop-label-comment">Comments:</label>
	        <textarea id="employer-body-message" name="comment">You can add comment here...</textarea>
	      </div>
	
	      <div class="btn-action"><input type="submit" value="Send"  id="send-comment" class="btn btn-105"/></div>
	        
	    </div>
	    </form> 
	    </center>
	<?php }?>